const path = require("path");
const resolve = (dir) => path.join(__dirname, dir);

module.exports = {
  pages: {
    index: {
      entry: "src/main.js",
    },
  },
  chainWebpack: (config) => {
    config.resolve.alias.set("@", resolve("src"));
  },

  devServer: {
    proxy: {
      "/teacher-api": {
        target: "http://localhost:9000",
        pathRewrite: { "^/teacher-api": "" },
        changeOrigin: true,
      },
      "/student-api": {
        target: "http://localhost:9000",
        pathRewrite: { "^/student-api": "" },
        changeOrigin: true,
      },
      "/course-api": {
        target: "http://localhost:9000",
        pathRewrite: { "^/course-api": "" },
        changeOrigin: true,
      },
    },
  },
};
